package top.csy8888.ch10.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.csy8888.ch10.service.PublishService;

/**
 * @author CSY
 * @date 2025 - 09 - 19
 */
@RestController
public class AdminController {
    private PublishService service;

    public AdminController(PublishService service) {
        this.service = service;
    }

    @PostMapping("/message")
    public String send(@RequestBody String message) {
        service.sendMessage(message);
        return "success";
    }
}
